<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
    <!-- Google Chrome Frame也可以让IE用上Chrome的引擎: -->
    <meta name="renderer" content="webkit">
    <!--国产浏览器高速模式-->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="author" content="穷在闹市"/>
    <!-- 作者 -->
    <meta name="revised" content="穷在闹市.v3, 2019/05/01"/>
    <!-- 定义页面的最新版本 -->
    <meta name="description" content="网站简介"/>
    <!-- 网站简介 -->
    <meta name="keywords" content="搜索关键字，以半角英文逗号隔开"/>
    <title>重竞技运动管理登录</title>

    <!-- 公共样式 开始 -->
    <link rel="shortcut icon" href="images/favicon.ico"/>
    <link rel="bookmark" href="images/favicon.ico"/>
    <link rel="stylesheet" type="text/css" href="css/base.css">
    <link rel="stylesheet" type="text/css" href="fonts/iconfont.css">
    <script type="text/javascript" src="framework/jquery-1.11.3.min.js"></script>
    <link rel="stylesheet" type="text/css" href="layui/css/layui.css">
    <!--[if lt IE 9]>
    <script src="framework/html5shiv.min.js"></script>
    <script src="framework/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript" src="layui/layui.js"></script>
    <script src="framework/cframe.js"></script><!-- 仅供所有子页面使用 -->
    <!-- 公共样式 结束 -->

    <link rel="stylesheet" type="text/css" href="css/login.css">
    <script type="text/javascript" src="js/login.js"></script>
</head>

<body>

<!--主体 开始-->
<div class="login_main">
    <!--轮播图 开始-->
    <div class="layui-carousel lbt" id="loginLbt">
        <div carousel-item>
            <div class="item" style="background: url(images/login_bg1.jpg) no-repeat; background-size: cover;"></div>
            <div class="item" style="background: url(images/login_bg2.jpg) no-repeat; background-size: cover;"></div>
        </div>
    </div>
    <!--轮播图 结束-->
    <div class="logo">
        <img src="images/login_logo.png"/>
        <div>
            <h1>奥林匹克运动管理系统</h1>
            <p>登录界面</p>
        </div>
    </div>
    <div class="form_tzgg">
        <div class="form">
            <form action="" method="get" class="layui-form">
                <div class="title">用户登录</div>
                <div class="con" onclick="getFocus(this)">
                    <input type="text" name="userName" lay-verify="userName" placeholder="请输入您的用户名" autocomplete="off"
                           class="layui-input">
                </div>
                <div class="con" onclick="getFocus(this)">
                    <input type="password" name="userPassword" required lay-verify="userPassword"
                           placeholder="请输入您的账户密码" autocomplete="off" class="layui-input">
                </div>
                <div class="but">
                    <button class="layui-btn" lay-submit lay-filter="submitBut">登录</button>
                </div>
                <div class="apply"><a href="#">找回密码</a></div>
            </form>
        </div>
        <script>
            layui.use(['form','layer'], function () {
                var form = layui.form;
                var layer = layui.layer;
                form.verify({
                    userName: function (value, item) { //value：表单的值、item：表单的DOM对象
                        if (value == null || value == "") {
                            return '请输入您的用户名！';
                        }
                    },
                    userPassword: function (value, item) {
                        if (value == null || value == "") {
                            return '请输入您的账户密码！';
                        }
                    }
                });
                //监听提交
                form.on('submit(submitBut)', function (data) {
                    var index1 = layer.load(3);
                    var url = "../Tuser/login";
                    $.get(url, data.field, function (obj) {
                        layer.close(index1);    //返回数据关闭loading
                        if (obj.status == 1) {
                            layer.msg(obj.msg, {
                                icon: 1,
                                time: 1000
                                //一秒关闭 如果不配置是3秒
                            }, function () {
                                location.href = "frame2.html";
                            });

                        } else {
                            layer.msg(obj.msg, {
                                icon: 2,
                                time: 1000
                                //一秒关闭 如果不配置是3秒
                            })
                        }
                    }, "json")
                    return false;
                });
            });
        </script>
        <div class="tzgg">
            <div class="title">通知公告</div>
            <div class="con">
                <ul>
                    <li><span>05-01</span><a href="#" target="_blank">奥林匹克框架升级</a></li>
                    <li><span>04-16</span><a href="#" target="_blank">穷在闹市无人问，富在深山有远亲</a></li>
                    <li><span>02-23</span><a href="#" target="_blank">没有最好的代码，只有最好的思路</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--主体 结束-->
</body>

</html>